package com.usian.controller;


import com.usian.api.wemedia.LoginControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.dtos.WmUserDto;
import com.usian.service.WmUserService;
import com.usian.utils.threadlocal.WmThreadLocalUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController implements LoginControllerApi {

    @Autowired
    private WmUserService wmUserService;


    @Override
    @PostMapping("in")
    public ResponseResult login(@RequestBody WmUserDto dto) {
       return  wmUserService.login(dto);
    }

    @PostMapping("dodo")
    public String dodo(){
        System.out.println(WmThreadLocalUtils.getUserid());
        return "dodo";
    }
}
